<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电梯模拟</title>
    <link rel="stylesheet" href="plugins/bootstrap-3.3.4/css/bootstrap.min.css">
    <link rel="stylesheet" href="plugins/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="styles/xstyle.css">
    <link rel="stylesheet" href="plugins/xelevator/xelevator.css">
    <style type="text/css">
        .left-wrap{
            float: left;
            width: 600px;
        }

        .right-wrap{
            float: left;
            width: 400px;
        }

        .right-wrap::after{
            content: '';
            clear: both;
        }
    </style>
</head>
<body>
    <div class="left-wrap">
        <div class="xelevator">
            <ul class="building">
            </ul>
            <div class="car"></div>
        </div>
    </div>
    <div class="right-wrap">
        <h2 class="text-center">乘客叫电梯</h2>
        <div class="form-horizontal">
            <div class="form-group">
                <label for="sltFrom" class="col-xs-4 control-label">所在楼层</label>
                <div class="col-xs-8">
                    <select id="sltFrom" class="form-control">
                        <option value="0">1</option>
                        <option value="1">2</option>
                        <option value="2">3</option>
                        <option value="3">4</option>
                        <option value="4">5</option>
                        <option value="5">6</option>
                        <option value="6">7</option>
                        <option value="7">8</option>
                        <option value="8">9</option>
                        <option value="9">10</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="sltTo" class="col-xs-4 control-label">前往楼层</label>
                <div class="col-xs-8">
                    <select id="sltTo" class="form-control">
                        <option value="0">1</option>
                        <option value="1">2</option>
                        <option value="2">3</option>
                        <option value="3">4</option>
                        <option value="4">5</option>
                        <option value="5">6</option>
                        <option value="6">7</option>
                        <option value="7">8</option>
                        <option value="8">9</option>
                        <option value="9">10</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-offset-4 col-xs-8">
                    <button type="button" class="btn btn-primary" id="btnCall">准备上电梯</button>
                </div>
            </div>
        </div>
    </div>

    <script src="scripts/jquery-3.2.0.min.js"></script>
    <script src="plugins/bootstrap-3.3.4/js/bootstrap.min.js"></script>
    <script src="plugins/xelevator/xelevator.js"></script>
    <script type="text/javascript">
        //console.log(-1 == true);
        $(function () {
            var xelevator = new xElevator();
            xelevator.run();

            $('#btnCall').click(function(){
                xelevator.call({
                    speed: 100,
                    from: $('#sltFrom').val(),
                    to: $('#sltTo').val()
                });
            });
        });
    </script>
</body>
</html>